;回文串的判定
;DATE 2024/12/26 MADE BY TL
ASSUME CS:CODE,DS:DATA
DATA SEGMENT
	STRING DB 'abcdedcba'
	STR1 DB 'YES$'
	STR2 DB 'NO$'
DATA ENDS
CODE SEGMENT
START:
	MOV AX,DATA
	MOV DS,AX
	LEA SI,STRING
	LEA DI,STRING
	ADD DI,8
ROTATE:
	MOV AL,[SI]
	MOV BL,[DI];FOR DEBUG
	CMP AL,BL
	JE CONTINUE
	JMP OUTOFSTR_FALSE
CONTINUE:
	CMP SI,DI
	JE OUTOFSTR_TRUE
	INC SI
	DEC DI
	JMP ROTATE
OUTOFSTR_FALSE:
	LEA DX,STR2
	MOV AH,09H
	INT 21H
	MOV AX,4C00H
	INT 21H
OUTOFSTR_TRUE:
	LEA DX,STR1
	MOV AH,09H
	INT 21H
	MOV AX,4C00H
	INT 21H
CODE ENDS
END START
	
	